/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package drinkcounter.model;

import com.google.appengine.api.datastore.KeyFactory;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

/**
 *
 * @author Toni
 */
@Entity
public class Participant extends AbstractEntity{
    private String name;
    private Party party;
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Transient
    public String getId(){
        return KeyFactory.keyToString(getStoreKey());
    }

    @ManyToOne(fetch=FetchType.LAZY)
    public Party getParty() {
        return party;
    }

    public void setParty(Party party) {
        this.party = party;
    }
}
